<template>
  <el-container>
      <el-main>
        <div style="width: 64px;margin: 0px auto">
          <img src="../assets/logo.png" style="width: 64px">
        </div>
        <p style="text-align: center;font-size: 32px;font-weight: initial;margin: 0px auto">慕课大学登录</p>
        <el-from ref="form" :model="user" :rules="rules">
            <el-from-item>
                <el-input type="text" v-model="user.username" prefix-icon="el-icon-user-solid" placeholder="账号"></el-input>
            </el-from-item>
          <el-from-item>
                <el-input type="password" v-model="user.paswd" prefix-icon="el-icon-lock" placeholder="密码"></el-input>
          </el-from-item>
          <el-button @click="button" style="color: #fff;background-color:#25b864;width: 358px;height: 40px">登录</el-button>
        </el-from>
      </el-main>
  </el-container>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      user :{
        username :'',
        password :''
      },
      message:'',
      rules:{
        username:[
          {required:true,message:'账号不能为空',trigger:'blur'}
        ],
        password: [
          {required: true, message: '密码不能为空', trigger: 'blur'}
        ]
        }
      }
    },
  methods:{
    button(){
      this.$router.push('/index');
    }
  }
}

</script>

<style scoped>

</style>